import request from './index'

export interface INF_ValidCode_res {
  ValidCodeImg: string
  Token: string
}

// 获取验证码
export function ValidCode() {
  return request({
    url: '/WeApp/ValidCode'
  })
}

export interface INF_Login_params {
  Hotel_id: string
  Name: string
  Pwd: string
  Token: string
  ValidCode: string
  SessionCode: string
}

export interface INF_Login_res {
  access_token: string
  refresh_token: string
  name: string
  msg: string
}

// 第二步，没有酒店绑定的时候 与酒店绑定（实施开通的已有的酒店名)
export function Login(data: INF_Login_params) {
  return request({
    url: '/WeApp/Login',
    method: 'post',
    data
  })
}

export interface accountModelType {
  OldPassword: string
  NewPassword: string
  ConfirmPassword: string
}
// 修改密码
export function ChangePwd(data: accountModelType) {
  return request({
    url: '/WeApp/ChangePwd',
    method: 'post',
    data
  })
}
